package ProxyPattern

import (
	"fmt"
	"os"
)

type ITextReader interface {
	LoadFile(filename string)
	PrintOutFile()
}

type TextReader struct {
	FileName    string
	FileContent string
}

func (t *TextReader) LoadFile(filename string) {
	t.FileName = filename
	f, _ := os.ReadFile(t.FileName)
	t.FileContent = string(f)
}

func (t *TextReader) PrintOutFile() {
	fmt.Println(t.FileContent)
}
